<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
  <th:block th:include="include :: header('完善项目信息')" />
</head>
<body>
<div class="ibox-content">
  <div class="nav-tabs-custom">
    <ul class="nav nav-tabs">
      <li><a th:href="@{'/project/projectInfo/edit/'+${projectId}}" aria-expanded="false">基本信息</a></li>
      <li><a th:href="@{'/project/projectFlow/edit/'+${projectId}}" aria-expanded="false">工艺处理流程</a></li>
      <li><a th:href="@{'/project/projectFlowParam/'+${projectId}}" aria-expanded="false">工艺处理流程参数</a></li>
      <li class="active"><a th:href="@{'/project/projectTech/edit/'+${projectId}}" aria-expanded="true">工艺运行情况</a></li>
      <li><a th:href="@{'/project/projectEqp/edit/'+${projectId}}" aria-expanded="false">设备运行情况</a></li>
      <li><a th:href="@{'/project/projectWater/edit/'+${projectId}}" aria-expanded="false">水质指标情况</a></li>
      <li><a th:href="@{'/project/projectMicro/edit/'+${projectId}}" aria-expanded="false">菌剂使用情况</a></li>
      <li><a th:href="@{'/project/projectPharm/edit/'+${projectId}}" aria-expanded="false">药剂使用情况</a></li>
    </ul>
    <div class="tab-content">
      <div class="tab-pane active">
        <form class="form-horizontal m" id="form-projectTech-edit" th:object="${projectTech}">
          <input name="techId" th:field="*{techId}"  type="hidden">
          <input name="projectId" th:field="*{projectId}" type="hidden">
          <div class="row">
            <div class="col-sm-6">
              <div class="form-group">
                <label class="col-sm-3 control-label">污水回流类型：</label>
                <div class="col-sm-7">
                  <select name="refluxType" class="form-control m-b" th:with="type=${@dict.getType('sewage_reflux_type')}">
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:field="*{refluxType}" th:value="${dict.dictValue}"></option>
                  </select>
                </div>
              </div>
            </div>
            <div class="col-sm-6">
              <div class="form-group">
                <label class="col-sm-3 control-label">回流起始位点：</label>
                <div class="col-sm-7">
                  <select name="refluxPoint" class="form-control">
                    <option value="">无</option>
                    <option th:each="sf:${sfList}" th:value="${sf.flowId}" th:field="*{refluxPoint}"
                            th:text="${sf.flowName}"></option>
                  </select>
                </div>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="col-sm-6">
              <div class="form-group">
                <label class="col-sm-3 control-label">回流比：</label>
                <div class="col-sm-7">
                  <select name="refluxRatio" class="form-control m-b" th:with="type=${@dict.getType('sewage_reflux_ratio')}">
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:field="*{refluxRatio}" th:value="${dict.dictValue}"></option>
                  </select>
                </div>
              </div>
            </div>
            <div class="col-sm-6">
              <div class="form-group">
                <label class="col-sm-3 control-label">图片：</label>
                <div class="col-sm-5">
                  <input name="refluxFile" type="file" accept="image/*">
                </div>
                <div class="col-sm-1">
                  <div th:if="${projectTech.refluxPicUrl != null and projectTech.refluxPicUrl != ''}">
                    <img class='img-circle img-xs' data-target='self' th:src="'/abvfile/tech/'+${projectTech.refluxPicUrl}">
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="col-sm-4">
              <div class="form-group">
                <label class="col-sm-5 control-label">是否污水短流：</label>
                <div class="col-sm-7">
                  <select name="streamType" class="form-control m-b" th:with="type=${@dict.getType('sys_yes_no')}">
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{streamType}"></option>
                  </select>
                </div>
              </div>
            </div>
            <div class="col-sm-4">
              <div class="form-group">
                <label class="col-sm-5 control-label">短流位点：</label>
                <div class="col-sm-7">
                  <select name="streamPoint" class="form-control">
                    <option value="">无</option>
                    <option th:each="sf:${sfList}" th:value="${sf.flowId}" th:field="*{streamPoint}"
                            th:text="${sf.flowName}"></option>
                  </select>
                </div>
              </div>
            </div>
            <div class="col-sm-4">
              <div class="form-group">
                <label class="col-sm-4 control-label">图片：</label>
                <div class="col-sm-6">
                  <input name="streamFile" type="file" accept="image/*">
                </div>
                <div class="col-sm-2">
                  <div th:if="${projectTech.streamPicUrl != null and projectTech.streamPicUrl != ''}">
                    <img class='img-circle img-xs' data-target='self' th:src="'/abvfile/tech/'+${projectTech.streamPicUrl}">
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="col-sm-4">
              <div class="form-group">
                <label class="col-sm-5 control-label">是否曝气不均：</label>
                <div class="col-sm-7">
                  <select name="aerationType" class="form-control m-b" th:with="type=${@dict.getType('sys_yes_no')}">
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{aerationType}"></option>
                  </select>
                </div>
              </div>
            </div>
            <div class="col-sm-4">
              <div class="form-group">
                <label class="col-sm-5 control-label">严重程度：</label>
                <div class="col-sm-7">
                  <select name="aerationLevel" class="form-control m-b" th:with="type=${@dict.getType('sewage_serious_level')}">
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{aerationLevel}"></option>
                  </select>
                </div>
              </div>
            </div>
            <div class="col-sm-4">
              <div class="form-group">
                <label class="col-sm-4 control-label">图片：</label>
                <div class="col-sm-6">
                  <input name="aerationFile" type="file" accept="image/*">
                </div>
                <div class="col-sm-2">
                  <div th:if="${projectTech.aerationPicUrl != null and projectTech.aerationPicUrl != ''}">
                    <img class='img-circle img-xs' data-target='self' th:src="'/abvfile/tech/'+${projectTech.aerationPicUrl}">
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="col-sm-4">
              <div class="form-group">
                <label class="col-sm-5 control-label">是否潜水推流不均：</label>
                <div class="col-sm-7">
                  <select name="diveType" class="form-control m-b" th:with="type=${@dict.getType('sys_yes_no')}">
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{diveType}"></option>
                  </select>
                </div>
              </div>
            </div>
            <div class="col-sm-4">
              <div class="form-group">
                <label class="col-sm-5 control-label">严重程度：</label>
                <div class="col-sm-7">
                  <select name="diveLevel" class="form-control m-b" th:with="type=${@dict.getType('sewage_serious_level')}">
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{diveLevel}"></option>
                  </select>
                </div>
              </div>
            </div>
            <div class="col-sm-4">
              <div class="form-group">
                <label class="col-sm-4 control-label">图片：</label>
                <div class="col-sm-6">
                  <input name="diveFile" type="file" accept="image/*">
                </div>
                <div class="col-sm-2">
                  <div th:if="${projectTech.divePicUrl != null and projectTech.divePicUrl != ''}">
                    <img class='img-circle img-xs' data-target='self' th:src="'/abvfile/tech/'+${projectTech.divePicUrl}">
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="col-sm-4">
              <div class="form-group">
                <label class="col-sm-5 control-label">其他问题：</label>
                <div class="col-sm-7">
                  <input name="otherProblem" class="form-control" type="text" th:field="*{otherProblem}" maxlength="20">
                </div>
              </div>
            </div>
            <div class="col-sm-4">
              <div class="form-group">
                <label class="col-sm-5 control-label">严重程度：</label>
                <div class="col-sm-7">
                  <select name="otherLevel" class="form-control m-b" th:with="type=${@dict.getType('sewage_serious_level')}">
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{otherLevel}"></option>
                  </select>
                </div>
              </div>
            </div>
            <div class="col-sm-4">
              <div class="form-group">
                <label class="col-sm-4 control-label">图片：</label>
                <div class="col-sm-6">
                  <input name="otherFile" type="file" accept="image/*">
                </div>
                <div class="col-sm-2">
                  <div th:if="${projectTech.otherPicUrl != null and projectTech.otherPicUrl != ''}">
                    <img class='img-circle img-xs' data-target='self' th:src="'/abvfile/tech/'+${projectTech.otherPicUrl}">
                  </div>
                </div>
              </div>
            </div>
          </div>
        </form>
      </div>
      <div class="row">
        <div class="col-sm-offset-5 col-sm-10">
          <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
          <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
        </div>
      </div>
    </div>
  </div>
</div>
<th:block th:include="include :: footer" />
<script type="text/javascript">
  var prefix = ctx + "project/projectTech";
  $("#form-projectTech-edit").validate({
    focusCleanup: true
  });

  function submitHandler() {
    if ($.validate.form()) {
      var data = new FormData($("#form-projectTech-edit")[0]);
      $.ajax({
        url: prefix + "/edit",
        type: "post",
        data: data,
        cache: false,
        processData: false,
        contentType: false,
        success: function(result) {
          if (result.code == web_status.SUCCESS) {
            layer.msg(result.msg, { icon: $.modal.icon(modal_status.SUCCESS), time: 1000},function() {
              location.reload();
            });
          } else if (result.code == web_status.WARNING) {
            $.modal.msgWarning(result.msg)
          } else {
            $.modal.msgError(result.msg);
          }
          $.modal.closeLoading();
        }
      });
    }
  }

  $.form.imgView("#form-projectTech-edit");
</script>
</body>
</html>